package com.shupian.controller;

import com.shupian.domain.ResponseResult;
import com.shupian.service.CategoryService;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "文章分类相关接口")
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 查询所有分类列表
     * @return
     */
    @ApiOperation(value = "查询所有分类列表",notes = "①要求只展示有发布正式文章的分类 ②必须是正常状态的分类")
    @GetMapping("/getCategoryList")
    public ResponseResult getCategoryList(){

        return categoryService.getCategoryList();
    }


}
